const baseUrl = "http://localhost:8080/piyaoh";
export const request = (url, method, data) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: baseUrl + url,
			data: data,
			method: method,
			header: {
				'Authorization': uni.getStorageSync("token")
			},
			success: (res) => {
				resolve(res)
			},
			fail: (error) => {
                uni.navigateTo({
                	url: "/pages/login/login"
                })
				reject(error)
			}
		})
	})
}
export default request